package com.jeady.jTools.feedback;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;

import androidx.annotation.NonNull;

import com.jeady.jTools.R;

public class AboutDialog extends Dialog {

    OnClickListener listener;
    public AboutDialog(@NonNull Context context, OnClickListener listener) {
        super(context);
        this.listener = listener;
    }
//
//    public AboutDialog(@NonNull Context context, int themeResId) {
//        super(context, themeResId);
//    }
//
//    protected AboutDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
//        super(context, cancelable, cancelListener);
//    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_about);
        findViewById(R.id.btn_agree).setOnClickListener(v -> {
            listener.onClick(1);
            dismiss();
        });
        findViewById(R.id.btn_disagree).setOnClickListener(v -> {
            System.exit(0);
        });
    }

    interface OnClickListener{
        void onClick(int which);
    }

}
